<style>
body{
	overflow-x:hidden;
}
</style>
	<div class="ui-portlet">
			<ol class="breadcrumb">
			  <li><a href="/users/index"><i class="fa fa-home"></i>&nbsp;&nbsp;{{__('Personal Center')}}</a></li>
			  <li class="active">编辑客户信息</li>
			</ol>
		</div>           
       <hr>

{{$this->Form->create('Customer',array('class'=>'form-horizontal','role'=>'form'))}}
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerName">公司名称</label>
		<div class="col-sm-9 controls">
			{{$this->Form->hidden('id')}}
			{{$this->Form->input('name',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
		</div>
	</div>
	<!--
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerPublished">封面图片</label>
		<div class="col-sm-9 controls select">
			{{$this->Swfupload->load('coverimg',array('modelClass'=>'Customer','label'=>false,'isadmin'=>false,'class'=>'form-control'))}}
		</div>
	</div>
	
		
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerPrice">客户简称</label>
		<div class="col-sm-9 controls number">
			<input type="number" id="CustomerPrice" step="any" class="form-control" name="data[Customer][shortname]">
		</div>
	</div>
	-->

	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerAddress">客户地址</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('address',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerWebsite">客户网址</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('website',array('label'=>false,'div'=>false,'type'=>'url','class'=>'form-control'))}}
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerCateId">客户分类</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('cate_id',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
			<p><a href="{{$this->Html->url('/user_cates/mine?model=Customer')}}"><small>管理客户分类</small></a></p>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerAddress">客户分级</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('grade',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerMobilePhone">联系手机</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('mobile_phone',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerTelephone">客户电话</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('telephone',array('label'=>false,'div'=>false,'class'=>'form-control'))}}
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerEmail">客户邮箱</label>
		<div class="col-sm-9 controls">
			{{$this->Form->input('email',array('label'=>false,'div'=>false,'type'=>'email','class'=>'form-control'))}}
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerName">更多描述</label>
		<div class="col-sm-9">
			{{$this->Form->input('description',array('label'=>false,'div'=>false,'rows'=>4,'cols'=>100,'class'=>'form-control'))}}
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label" for="CustomerName"></label>
		<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="提交"></div>
	</div>
</form>

{{$this->Html->script(array(
	'ckeditor/ckeditor.js',
	'swfupload/swfupload.js',
	'swfupload/swfupload.queue.js',
	'swfupload/swfupload.cookies.js',
	'swfupload/fileprogress.js',
	'swfupload/handlers.js',
))}}

<script>
$(function(){
	CKEDITOR.editorConfig = function( config ){
		config.toolbar = 'FRONT';
	}
	ckeditors['CustomerDescription'] = CKEDITOR.replace( 'CustomerDescription',
		    {
		        customConfig : '{{$this->Html->url("/js/ckeditor/front-config.js")}}'
		    });
	ckeditors['CustomerDescription'].on('focus',function(e){
		current_ckeditor_instance = e.editor;
	});
	

	CKEDITOR.on( 'instanceReady', function( e ){
		e.editor.document.appendStyleSheet( '{{$this->Html->url("/stylevars/getcss.css")}}' );
		e.editor.document.appendStyleSheet( '{{$this->Html->url("/css/ui-customer.css")}}' );
		//e.editor.setMode( 'source' );
		e.editor.on( 'mode', function( e ){
			if(e.editor.mode == 'wysiwyg'){
				e.editor.document.appendStyleSheet( '{{$this->Html->url("/stylevars/getcss.css")}}' );
				e.editor.document.appendStyleSheet( '{{$this->Html->url("/css/ui-customer.css")}}' );
			}
		});
		//if($('.cke_top').parent('ui-dialog-content').size()<1){
		//	$('.cke_top').addClass('clearfix').affix();
		//}
	});
})
</script>